package com.bw.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 
 * @TableName user
 */
@TableName(value ="user")
@Data
public class UserDemo implements Serializable {


    @NotBlank(message = "用户名不为空")
    private String name;

    @NotBlank(message = "手机号不为空")
    @Pattern(regexp = "/^(?:(?:\\+|00)86)?1\\d{10}$/")
    private String phone;

    /**
     *
     */
    @NotBlank(message = "密码不为空")

    //密码必须包含字母、数字
    @Length(min = 6,message = "密码必须包含字母、数字且长度大于6位") //且长度大于6位
    @Pattern(regexp = "/^[A-Za-z0-9]+$/",message = "密码必须包含字母、数字且长度大于6位")
    private String password;



    /**
     * 
     */
    private String salt;

    /**
     * 1 房东  0 客户
     */
    private Integer role;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}